The word "end" followed by the name of the message we are defining marks the end of this handler. The message name must match name in the previous "on".
You can handle more than one message in a single script. Each "on" . . . "end" pair is the handler of a single message.
If "end" does not line up with "on" at the left edge of the screen, something is wrong with your handler.